package com.example.demo.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.domain.entity.TrainClass;
import com.example.demo.domain.entity.TrainClassUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.demo.domain.model.ClassUserCount;
import com.example.demo.domain.vo.ClassUserSubmitInfoVo;
import com.example.demo.param.TrainClassUserParam;

import java.util.List;
import java.util.Map;

/**
* @author liguang
* @description 针对表【train_class_user(培训系统-班级-用户关系)】的数据库操作Service
* @createDate 2023-11-23 21:10:29
*/
public interface TrainClassUserService extends IService<TrainClassUser> {



    /**
     * 根据条件查询用户
     * @param param
     * @return
     */
    Page<TrainClassUser> queryByParam(TrainClassUserParam param);



    /**
     * 移除学生
     * @param trainClassId
     * @param userId
     * @return
     */
    boolean removeUser(Long trainClassId, Long userId);


    List<TrainClassUser> getByUserId(Long id);

    TrainClassUser queryByUserAndClass(Long trainClassId, Long id);

    List<TrainClassUser> getAllUserByClassId(Long trainClassId);

    Page<ClassUserSubmitInfoVo> getSubmitDetail(TrainClassUserParam trainClassUserParam);

    Page<TrainClass> queryClassByUserId(Long userId, Integer pageNumber, Integer pageSize);

    List<ClassUserCount> countNumber(List<Long> collect);

    /**
     * 根据用户姓名查询用户所在的所有班级
     * @param realName 真实姓名
     * @param pageNumber
     * @param pageSize
     * @return
     */
    Page<TrainClass> queryClassByRealName(String realName, Integer pageNumber, Integer pageSize);
}
